/*weSenOolfcPLiqI9p2fAV4pKQsBuN9hl2RI6P5PwWvhH/sKkGIiAgwTQZJb2cbcc*/
/*
 * @Author: xiahui 
 * @PageInfo: 生效 
 * @Date: 2019-01-18 14:44:00 
 * @Last Modified by: xiahui
 * @Last Modified time: 2019-07-10 15:51:46
 */
import { cardBaseScriptAction, showCardScriptActionDlg, isShowScriptActionDlg } from '../../utils/baseScriptUtil';
import { showWarningDialog } from '../../../../../scmpub/scmpub/pub/tool/messageUtil';
import { AREA, URL, FIELDS } from '../../constance';
import { getLangByResId } from '../../../../../scmpub/scmpub/pub/tool/multiLangUtil';

export default function(props) {
	showWarningDialog(getLangByResId(this, '4004PURDAILY-000042'), getLangByResId(this, '4004PURDAILY-000043'), {
		/* 国际化处理： 确认生效,是否确定将此合同生效*/
		beSureBtnClick: () => {
			let valdate = props.form.getFormItemsValue(AREA.cardFormId, FIELDS.valdate);
			let billDate = null;
			if (valdate) {
				billDate = props.form.getFormItemsValue(AREA.cardFormId, FIELDS.valdate).value;
			}
			if (billDate && billDate != null && isShowScriptActionDlg(billDate)) {
				showCardScriptActionDlg.call(
					this,
					props,
					URL.validate,
					getLangByResId(this, '4004PURDAILY-000044'),
					getLangByResId(this, '4004PURDAILY-000045')
				); /* 国际化处理： 生效成功,实际生效日期与计划生效日期不符，请输入原因*/
			} else {
				cardBaseScriptAction.call(
					this,
					props,
					URL.validate,
					getLangByResId(this, '4004PURDAILY-000044')
				); /* 国际化处理： 生效成功*/
			}
		}
	});
}

/*weSenOolfcPLiqI9p2fAV4pKQsBuN9hl2RI6P5PwWvhH/sKkGIiAgwTQZJb2cbcc*/